package com.netease.pris.activity.a;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.netease.framework.k;
import com.netease.image.d;
import com.netease.pris.activity.view.c;
import com.netease.pris.atom.g;
import com.netease.pris.atom.u;
import java.util.LinkedList;

public class p extends BaseAdapter
{
  private int a;
  private Context b = null;
  private LinkedList c;
  private LayoutInflater d = null;
  private View.OnClickListener e = null;

  public p(Context paramContext)
  {
    if (paramContext == null);
    while (true)
    {
      return;
      this.b = paramContext;
      this.d = LayoutInflater.from(this.b);
    }
  }

  private void a(q paramq, View paramView)
  {
    paramq.a = ((ImageView)paramView.findViewById(2131558436));
    paramq.b = ((ImageView)paramView.findViewById(2131558522));
    paramq.c = ((TextView)paramView.findViewById(2131558424));
    paramq.d = ((TextView)paramView.findViewById(2131558525));
    paramq.e = ((Button)paramView.findViewById(2131558526));
    paramq.e.setOnClickListener(this.e);
  }

  private void a(q paramq, u paramu, int paramInt)
  {
    if ((paramq == null) || (paramu == null))
      return;
    while (true)
    {
      try
      {
        String str1 = paramu.U();
        paramq.c.setText(str1);
        String str2 = paramu.X();
        paramq.d.setText(str2);
        paramq.e.setFocusable(false);
        paramq.e.setClickable(true);
        c localc1 = new c();
        localc1.a = paramu.V();
        localc1.b = paramInt;
        paramq.e.setTag(localc1);
        c localc2 = new c();
        localc1.a += "mark";
        paramq.b.setTag(localc2);
        if (!paramu.ak())
          break label271;
        paramq.e.setVisibility(0);
        paramq.b.setVisibility(0);
        paramq.e.setText(2131361879);
        paramq.e.setCompoundDrawablesWithIntrinsicBounds(2130837548, 0, 0, 0);
        paramq.a.setImageDrawable(k.a(this.b).b(2130837804));
        String str3 = paramu.b(g.g);
        if (str3 == null)
          break;
        StringBuilder localStringBuilder = new StringBuilder();
        paramq.a.setTag(localStringBuilder);
        d.a().a(localStringBuilder, 1, str3, new e(this, paramq), -1, -1, 2, this.a);
      }
      catch (NullPointerException localNullPointerException)
      {
        localNullPointerException.printStackTrace();
      }
      break;
      label271: if (paramu.al())
      {
        paramq.e.setVisibility(0);
        paramq.b.setVisibility(8);
        paramq.e.setText(2131361909);
        paramq.e.setCompoundDrawablesWithIntrinsicBounds(2130837547, 0, 0, 0);
        continue;
      }
      paramq.e.setVisibility(8);
      paramq.b.setVisibility(8);
    }
  }

  /** @deprecated */
  public void a()
  {
    monitorenter;
    try
    {
      if (this.c != null)
      {
        this.c.clear();
        notifyDataSetChanged();
      }
      monitorexit;
      return;
    }
    finally
    {
      localObject = finally;
      monitorexit;
    }
    throw localObject;
  }

  public void a(int paramInt)
  {
    this.a = paramInt;
  }

  public void a(View.OnClickListener paramOnClickListener)
  {
    this.e = paramOnClickListener;
  }

  public void a(LinkedList paramLinkedList)
  {
    this.c = paramLinkedList;
  }

  public u b(int paramInt)
  {
    if ((this.c != null) && (paramInt >= 0) && (this.c.size() > 0))
      if (paramInt >= this.c.size())
        paramInt = -1 + this.c.size();
    for (u localu = (u)this.c.get(paramInt); ; localu = null)
      return localu;
  }

  /** @deprecated */
  public void b(LinkedList paramLinkedList)
  {
    monitorenter;
    try
    {
      if (this.c != null)
      {
        this.c.addAll(paramLinkedList);
        notifyDataSetChanged();
      }
      monitorexit;
      return;
    }
    finally
    {
      localObject = finally;
      monitorexit;
    }
    throw localObject;
  }

  public int getCount()
  {
    int i = 0;
    if (this.c != null)
      i = this.c.size();
    return i;
  }

  public long getItemId(int paramInt)
  {
    return paramInt;
  }

  public View getView(int paramInt, View paramView, ViewGroup paramViewGroup)
  {
    q localq;
    if ((paramView != null) && ((paramView.getTag() instanceof q)))
      localq = (q)paramView.getTag();
    while (true)
    {
      u localu = b(paramInt);
      if (localu != null)
        a(localq, localu, paramInt);
      return paramView;
      paramView = this.d.inflate(2130903078, null);
      localq = new q(this);
      a(localq, paramView);
      paramView.setTag(localq);
    }
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.a.p
 * JD-Core Version:    0.6.0
 */